<?php 
$main_id = "";
$sub_id = "";
$page_link = "";
if(isset($_GET['main_id']))
{
	$main_id = $_GET['main_id'];
	$page_link .= "&main_id=".$main_id;
}

if(isset($_GET['sub_id']))
{
	$sub_id  = $_GET['sub_id'];
	$page_link .= "&sub_id=".$sub_id;
}

$sql = "SELECT * FROM fix_sub_products_type WHERE fix_main_products_type_id = $main_id";
$rsd = mysql_query($sql);
$selected = "";

while($row = mysql_fetch_array($rsd)){
	if($default_main  == "")
		$default_main  = $row['fix_main_products_type_id'];
	
	if($row['fix_sub_products_type_id'] == $sub_id)
		$selected = "selected=\"selected\"";
	else 
		$selected = "";
	echo "<option value=\"".$row['fix_sub_products_type_id']."\" $selected>".$row['fix_sub_products_type_name']."</option>";
}
?>